import google.generativeai as genai


### 入门教程  https://ai.google.dev/gemini-api/docs/ai-studio-quickstart?hl=zh-cn
genai.configure(api_key="AIzaSyBJoz7BvdFgWTBwzcu-0xWpJKfEJOR6vPM")
model = genai.GenerativeModel('gemini-pro')
response = model.generate_content("who is akulaku CEO")
print(response.text)

result = genai.embed_content(
    model="models/embedding-001",
    content="What is the meaning of life?",
    task_type="retrieval_document",
    title="Embedding of single string",
    output_dimensionality=1024)

# 1 input > 1 vector output
print(len(result['embedding']))
print(str(result['embedding'])[:50], '... TRIMMED]')